/*
 * COPYRIGHT. HSBC HOLDINGS PLC 2016. ALL RIGHTS RESERVED.
 * 
 * This software is only to be used for the purpose for which it has been
 * provided. No part of it is to be reproduced, disassembled, transmitted,
 * stored in a retrieval system nor translated in any human or computer
 * language in any way or for any other purposes whatsoever without the
 * written consent of HSBC Holdings plc.
 */
package com.pactera.integral.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.pactera.integral.entity.UserGroup;

/**
 * @type_name RoleUserDao
 */
@Repository("userGroupDao")
public interface UserGroupDao extends CommonRepository<UserGroup, String>{

	 @Transactional
	 @Modifying
	 @Query(value = "delete from SYS_USER_GROUP where user_id =:userId ", nativeQuery = true)
	 int deleteUserGroup(@Param("userId")String userId);

	 List<UserGroup> findByUserId(String userId);

	 List<UserGroup> findByGroupId(String groupId);
}
